<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of SDbAuthManager
 *
 * @author ssoldatos
 */
class SDbAuthManager extends CDbAuthManager {
  public function checkAccess($itemName, $userId, $params=array()) {
  	//判断是否是超级管理员
  	if(in_array(Yii::app()->user->id,Yii::app()->params['administrator'])){
  		return true;
  	}
    if (!empty($this->defaultRoles) && in_array($itemName,$this->defaultRoles)) {
      return true;
    }
	$role_auth = Yii::app()->user->get_auth_power();//echo '<pre>';print_r($role_auth);exit;
    if(!empty($role_auth) && in_array($itemName,$role_auth)){
    	return true;
    }
    return false;
  }

}
?>
